package com.xiaoxu.intranetweb.mybatisplusSzappdb.vo.Constructor;

import com.xiaoxu.intranetweb.mybatisplusSzappdb.entity.SysIntranetWebMenu;
import com.xiaoxu.intranetweb.mybatisplusSzappdb.vo.GetWebMenuVo;
import org.springframework.stereotype.Component;

import javax.swing.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

@Component
public class SysIntranetWebMenu2GetWebMenuVo {
//    组建mate
    public  Map<String,String> setMeta(String Title,String Orderno, String Dynamiclevel, String Realpath, String Ignoreauth, String Roles, String Ignorekeepalive,String Affix,String Icon, String Framesrc,
                       String Transitionname,String Hidebreadcrumb,String Hidechildreninmenu,
                     String Carryparam,String Single,String Currentactivemenu,
                       String   Hidetab,String Hidemenu,String Islink,String Ignoreroute,String Hidepathforchildren) {
           Map<String,String> meta = new HashMap();
                meta.put("title",Title);
                meta.put("orderno",Orderno);
                meta.put("dynamiclevel",Dynamiclevel);
                meta.put("realpath",Realpath);
                meta.put("ignoreauth",Ignoreauth);
                meta.put("roles",Roles);
                meta.put("ignorekeepalive",Ignorekeepalive);
                meta.put("affix",Affix);
                meta.put("icon",Icon);
                meta.put("framesrc",Framesrc);
                meta.put("transitionname",Transitionname);
                meta.put("hidebreadcrumb",Hidebreadcrumb);
                meta.put("hidechildreninmenu",Hidechildreninmenu);
                meta.put("carryparam",Carryparam);
                meta.put("single",Single);
                meta.put("currentactivemenu",Currentactivemenu);
                meta.put("hidetab",Hidetab);
                meta.put("hidemenu",Hidemenu);
                meta.put("islink",Islink);
                meta.put("ignoreroute",Ignoreroute);
                meta.put("hidepathforchildren",Hidepathforchildren);
        return meta;
    }
    public GetWebMenuVo GetWebMenuVo(SysIntranetWebMenu sysIntranetWebMenu) {
        GetWebMenuVo getWebMenuVo = new GetWebMenuVo();
        getWebMenuVo.setId(sysIntranetWebMenu.getWebPageId());
        getWebMenuVo.setWebPageId(sysIntranetWebMenu.getWebPageId());
        getWebMenuVo.setWebPageNumber(sysIntranetWebMenu.getWebPageNumber());
        getWebMenuVo.setWebPageTruname(sysIntranetWebMenu.getWebPageTruname());
        getWebMenuVo.setWebPageCreatetime(sysIntranetWebMenu.getWebPageCreatetime());
        getWebMenuVo.setWebPagePath(sysIntranetWebMenu.getWebPagePath());
        getWebMenuVo.setComponent(sysIntranetWebMenu.getWebPageComponent());
        getWebMenuVo.setWebPageMeta(sysIntranetWebMenu.getWebPageMeta());
        getWebMenuVo.setTitle(sysIntranetWebMenu.getWebPageTruname());
        getWebMenuVo.setName(sysIntranetWebMenu.getWebPageName());
        getWebMenuVo.setWebPageAlias(sysIntranetWebMenu.getWebPageAlias());
        getWebMenuVo.setRedirect(sysIntranetWebMenu.getWebPageRedirect());
        getWebMenuVo.setWebPageCasesensitive(sysIntranetWebMenu.getWebPageCasesensitive());
        getWebMenuVo.setWebPageParent(sysIntranetWebMenu.getWebPageParent());
        getWebMenuVo.setWebPageRoutelevel(sysIntranetWebMenu.getWebPageRoutelevel());
        getWebMenuVo.setWebPageStatus(sysIntranetWebMenu.getWebPageStatus());
        getWebMenuVo.setMeta(this.setMeta(
                sysIntranetWebMenu.getWebPageMetaTitle(),
                sysIntranetWebMenu.getWebPageMetaOrderno(),sysIntranetWebMenu.getWebPageMetaDynamiclevel(), sysIntranetWebMenu.getWebPageMetaRealpath(),
                sysIntranetWebMenu.getWebPageMetaIgnoreauth(), sysIntranetWebMenu.getWebPageMetaRoles(), sysIntranetWebMenu.getWebPageMetaIgnorekeepalive(),
                sysIntranetWebMenu.getWebPageMetaAffix(), sysIntranetWebMenu.getWebPageMetaIcon(), sysIntranetWebMenu.getWebPageMetaFramesrc(),
                sysIntranetWebMenu.getWebPageMetaTransitionname(), sysIntranetWebMenu.getWebPageMetaHidebreadcrumb(), sysIntranetWebMenu.getWebPageMetaHidechildreninmenu(),
                sysIntranetWebMenu.getWebPageMetaCarryparam(), sysIntranetWebMenu.getWebPageMetaSingle(), sysIntranetWebMenu.getWebPageMetaCurrentactivemenu(),
                sysIntranetWebMenu.getWebPageMetaHidetab(), sysIntranetWebMenu.getWebPageMetaHidemenu(), sysIntranetWebMenu.getWebPageMetaIslink(),
                sysIntranetWebMenu.getWebPageMetaIgnoreroute(), sysIntranetWebMenu.getWebPageMetaHidepathforchildren()
        ));
        getWebMenuVo.setChildren(new ArrayList<>());
        return getWebMenuVo;
    }
    public SysIntranetWebMenu sysIntranetWebMenu(GetWebMenuVo getWebMenuVo) {
        SysIntranetWebMenu sysIntranetWebMenu = new SysIntranetWebMenu();
        sysIntranetWebMenu.setWebPageId(getWebMenuVo.getId());
        sysIntranetWebMenu.setWebPageNumber(getWebMenuVo.getWebPageNumber());
        sysIntranetWebMenu.setWebPageTruname(getWebMenuVo.getWebPageTruname());
        sysIntranetWebMenu.setWebPageCreatetime(getWebMenuVo.getWebPageCreatetime());
        sysIntranetWebMenu.setWebPagePath(getWebMenuVo.getWebPagePath());
        sysIntranetWebMenu.setWebPageComponent(getWebMenuVo.getComponent());
        sysIntranetWebMenu.setWebPageMeta(getWebMenuVo.getWebPageMeta());
        sysIntranetWebMenu.setWebPageMetaOrderno(getWebMenuVo.getOrderNo());
        sysIntranetWebMenu.setWebPageTruname(getWebMenuVo.getTitle());
        sysIntranetWebMenu.setWebPageMetaDynamiclevel(getWebMenuVo.getDynamicLevel());
        sysIntranetWebMenu.setWebPageMetaRealpath(getWebMenuVo.getRealPath());
        sysIntranetWebMenu.setWebPageMetaIgnoreauth(getWebMenuVo.getIgnoreAuth());
        sysIntranetWebMenu.setWebPageMetaRoles(getWebMenuVo.getRoles());
        sysIntranetWebMenu.setWebPageMetaIgnorekeepalive(getWebMenuVo.getIgnoreKeepAlive());
        sysIntranetWebMenu.setWebPageMetaAffix(getWebMenuVo.getAffix());
        sysIntranetWebMenu.setWebPageMetaIcon(getWebMenuVo.getIcon());
        sysIntranetWebMenu.setWebPageMetaFramesrc(getWebMenuVo.getFrameSrc());
        sysIntranetWebMenu.setWebPageMetaTransitionname(getWebMenuVo.getTransitionName());
        sysIntranetWebMenu.setWebPageMetaHidebreadcrumb(getWebMenuVo.getHideBreadcrumb());
        sysIntranetWebMenu.setWebPageMetaHidechildreninmenu(getWebMenuVo.getHideChildrenInMenu());
        sysIntranetWebMenu.setWebPageMetaCarryparam(getWebMenuVo.getCarryParam());
        sysIntranetWebMenu.setWebPageMetaSingle(getWebMenuVo.getSingle());
        sysIntranetWebMenu.setWebPageMetaCurrentactivemenu(getWebMenuVo.getCurrentActiveMenu());
        sysIntranetWebMenu.setWebPageMetaHidetab(getWebMenuVo.getHideTab());
        sysIntranetWebMenu.setWebPageMetaHidemenu(getWebMenuVo.getHideMenu());
        sysIntranetWebMenu.setWebPageMetaIslink(getWebMenuVo.getIsLink());
        sysIntranetWebMenu.setWebPageMetaIgnoreroute(getWebMenuVo.getIgnoreRoute());
        sysIntranetWebMenu.setWebPageMetaHidepathforchildren(getWebMenuVo.getHidePathForChildren());
        sysIntranetWebMenu.setWebPageName(getWebMenuVo.getName());
        sysIntranetWebMenu.setWebPageAlias(getWebMenuVo.getWebPageAlias());
        sysIntranetWebMenu.setWebPageRedirect(getWebMenuVo.getRedirect());
        sysIntranetWebMenu.setWebPageCasesensitive(getWebMenuVo.getWebPageCasesensitive());
        sysIntranetWebMenu.setWebPageParent(getWebMenuVo.getWebPageParent());
        sysIntranetWebMenu.setWebPageRoutelevel(getWebMenuVo.getWebPageRoutelevel());
        sysIntranetWebMenu.setWebPageStatus(getWebMenuVo.getWebPageStatus());
        return sysIntranetWebMenu;
    }
}
